Open
Conversation
Also, remove `dbg!` statements and don't mark egraph as dirty after removing enodes
Matches type signature of `Runner::run`
Breaks explanations, specifically `diff_power_harder` in tests/math.rs fails
Oddly this appears to result in more failures in `cargo test --test math`.
Turns out the math.rs tests were modifying the egraph (see https://github.com/egraphs-good/egg/blob/ae2db378d25dbe55046d96a7eef25ee9f2916058/tests/math.rs#L98-L99), so the `None` path being taken is actually a bug if enodes aren't being removed by my code (`remove_enodes` specifically).
Compare by value instead of ID, since an enode may have multiple IDs (at least in `egraph.nodes`).
Also, hardcode running inverse equality saturation every iteration for now.
Also improve checking egraph validity when `cfg(debug_assertions)`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Entry point is
egraph.undo_rewrites().For testing,
undo_rewritesis hardcoded to run every iteration of equality saturation. This is too aggressive for real usage, since it strips away useful e-nodes before they can be extracted. As a result most test cases fail (errors are usually of the formgoal is not reached). However, inverse equality saturation should never "break" the egraph — right now it skips removing enodes from the original egraph (before rewrites were applied).Currently,
undo_rewritescannot handle multipatterns (onlyPatterns) and does not work with explanations enabled.